package seatiger.tomcat.catalina;

import seatiger.tomcat.util.buf.ByteChunk;

/**
 * 常量
 */
public class Constants {

    public static final String APPLICATION_WEB_XML = "/WEB-INF/web.xml";

    public static final String PACKAGE_CORE = "seatiger.tomcat.catalina.core";
    public static final String PACKAGE_STARTUP = "seatiger.tomcat.catalina.startup";
    public static final String PACKAGE_CONNECTOR = "seatiger.tomcat.catalina.connector";
    public static final String PACKAGE_HTTP11 = "seatiger.tomcat.coyote.http11";

    public static final String PACKAGE_SESSION = "seatiger.tomcat.catalina.session";


    /**
     * CR.
     */
    public static final byte CR = (byte) '\r';

    /**
     * LF.
     */
    public static final byte LF = (byte) '\n';

    /**
     * SP.
     */
    public static final byte SP = (byte) ' ';

    /**
     * HT.
     */
    public static final byte HT = (byte) '\t';

    /**
     * '?'.
     */
    public static final byte QUESTION = (byte) '?';

    /**
     * COLON.
     */
    public static final byte COLON = (byte) ':';

    /**
     * 'A'.
     */
    public static final byte A = (byte) 'A';


    /**
     * 'a'.
     */
    public static final byte a = (byte) 'a';


    /**
     * 'Z'.
     */
    public static final byte Z = (byte) 'Z';

    /**
     * Lower case offset.
     */
    public static final byte LC_OFFSET = A - a;


    /**
     * Identity filter 在数组中的位置
     */
    public static final int IDENTITY_FILTER = 0;

    /**
     * void filter在数组中的位置
     */
    public static final int VOID_FILTER = 1;

    /**
     * chunked filter在数组中的位置
     */
    public static final int CHUNKED_FILTER = 2;


    public static final String HTTP_11 = "HTTP/1.1";
    public static final byte[] HTTP_11_BYTES = ByteChunk.convertToBytes(HTTP_11);

    //200的状态码
    public static final byte[] _200_BYTES =  ByteChunk.convertToBytes("200");
}
